#导入模块

from stu import *


s = Stu()

while True:
    
    
    
    print("="*10,"学员管理系统","="*10)
    
    print("{}{:10}{:15}".format(" ","1.查看学员信息","2.添加学员信息"))
    print("{}{:10}{:15}".format(" ","3.删除学员信息","4.退出系统"))
    
    key = input("请输入对应的选择：")

    if key == '1':

        print("="*10,"学员信息浏览","="*10)
        s.findAll()
        input("按回车键继续：")
        
    elif key == '2':
        
        print("="*10,"学员信息添加","="*10)
        name = input("请输入要添加的姓名：")
        age = input("请输入要添加的年龄：")
        sex = input("请输入要添加的性别：")
        classid = input("请输入要添加的班级号：")
        i = '"{}","{}","{}","{}"'.format(name,age,sex,classid)
        print(i)
        s.insert(i)
        s.findAll()
        input("按回车键继续：")
        
    elif key == '3':
        
        print("="*10,"学员信息删除","="*10)
        s.findAll()
        #print("id=",s.findAll(id))
        delete_id = input("请输入要删除的学员id：")
        #if delete_id in s.findAll(id):
        s.delete(delete_id)
        s.findAll()
        input("按回车键继续：")
        #else:
            #print("学员id号不存在。")
            
    elif key == '4':
        
        print("="*10,"再见","="*10)
        break
    
    else:
        print("无效的输入！")
        
